// logs.js
import pubsub from 'pubsub-js';
const util = require('../../utils/util.js')
const app = getApp();

Page({
  data: {
    logs: []
  },
  onLoad(options) {
    console.log(options);
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return {
          date: util.formatTime(new Date(log)),
          timeStamp: log
        }
      })
    })

    console.log(app.globalData.token);
    // 发布消息（触发事件）：发送数据
    pubsub.publish('receive_msg', 12345678)

    console.log(getCurrentPages());

    const pages = getCurrentPages();
    const index = pages[pages.length - 2];
    console.log(index.data.count);
  }
})
